import do_print from '../../../../../hrpub/common/utils/print';
export default function(tableid) {
    const {
        editTable,
        meta
    } = this.props;
    let allTableList = this.props.editTable.getAllRows(tableid);
    let template = this.props.meta.getMeta()[tableid];
    allTableList.map((item) => {
        if(item.values.isallowedit.value == true){
            item.values.isallowedit.value = this.state.json['hihr-000034']
        }else{
            item.values.isallowedit.value = this.state.json['hihr-000035']
        }
    })
    do_print(document.querySelector('#tableListData'), {
        title: this.state.telName,
        maker: this.state.json['hihr-000004'],
        date: this.state.json['hihr-000005'],
        // beforeAppend: (data) => {
            // data[0].map((item,index) => {
            //     if(index != 0){
            //         item[0] = index;
            //         item.splice(1, 1);
            //     }
            // });
            // data[1].map((item,index) => {
            //     if(index != 0){
            //         item.splice(0, 1);
            //     }else{
            //         item.splice(1, 1);
            //     }
            // })
        //     return data;
        // }
    },{
        data: allTableList,
        tableTmp: template
    })
}